//package org.ricks.robot.business;
//
//import org.ricks.net.transport.kcp.KcpSession;
//import org.ricks.protocol.ByteBuf;
//import org.ricks.robot.Monitor;
//import org.ricks.robot.RobotInfo;
//import org.ricks.robot.RobotManager;
//import proto.common.FProto;
//import proto.common.PBPlayer;
//
//public class RobotChannelAction {
//
//
//    public static void channelJump(KcpSession session) {
//        RobotInfo robotInfo = RobotManager.get(session);
//        int index = robotInfo.robotAccount.lastIndexOf("-") + 1;
//        String robotNum = robotInfo.robotAccount.substring(index, robotInfo.robotAccount.length());
//        int channelId = Integer.valueOf(robotNum) / 30 + 1;
//        System.err.println(robotNum + " --------------------- 分配 channelId:" + channelId);
//        Monitor.addActionRequest(session, FProto.Action.ChannelJump);
//        robotInfo.requestTimeMap.put(FProto.Action.ChannelJump, System.currentTimeMillis());
//        PBPlayer pbPlayer;
//        if(robotNum.equals("3")) {
//            pbPlayer = PBPlayer.newBuilder().setChannelId(2).build();
//        } else {
//            pbPlayer = PBPlayer.newBuilder().setChannelId(channelId).build();
//        }
//
//        FProto fProto = FProto.newBuilder()
//                .setKey(FProto.Key.Base)
//                .setAction(FProto.Action.ChannelJump)
//                .setSelf(pbPlayer)
//                .build();
//
//        byte[] data = fProto.toByteArray();
//
//        ByteBuf buf = new ByteBuf(1024);
//        buf.writeByte((byte) 0x03);
//        buf.writeBytes(data);
//
//        session.send(buf.toArray());
//    }
//
//
//}
